from django.db import models
import random


# 用户模型表
class UserProfile(models.Model):
    username = models.CharField(verbose_name='用户名', max_length=11, primary_key=True)
    nickname = models.CharField(verbose_name='昵称', max_length=30)
    password = models.CharField(verbose_name='密码', max_length=32)
    email = models.EmailField(verbose_name='邮箱')
    phone = models.CharField(verbose_name='手机号', max_length=11)
    avatar = models.ImageField(verbose_name='头像', upload_to='avatar', null=True)
    sign = models.CharField(verbose_name='个人签名', max_length=50, default=random.choice(['来吧,兄弟', '奔跑吧, 兄弟']))
    info = models.CharField(verbose_name='个人简介', max_length=150, default='')
    created_time = models.DateTimeField(auto_now_add=True)
    updated_time = models.DateTimeField(auto_now=True)

    class Meta:
        # 配置表名称
        db_table = 'user_user_profile'
